package cn.gyouzhe.component.disruptor;

import com.lmax.disruptor.EventHandler;

/**
 * 抽象执行器
 *
 * @author wangchuan
 * @datetime 2018/2/12 22:06
 */
public abstract class AbstractHandler implements EventHandler<Event> {

    @Override
    public final void onEvent(Event event, long sequence, boolean endOfBatch) throws Exception {
        handle(event.getData());
    }

    /**
     * 处理信息
     * @param data
     */
    public abstract void handle(Object data);
}
